package com.hdy.demo.tag.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.hdy.demo.tag.dao.PagingDao;
import com.hdy.demo.tag.dao.PagingSqlDao;
import com.hdy.demo.tag.entity.Groups;
import com.hdy.demo.tag.service.PagingService;
import com.hdy.framework.common.service.impl.CommonServiceImpl;
import com.hdy.login.entity.User;
@Scope("singleton")
@Component("pagingServiceAop")
public class PagingServiceAopImpl extends CommonServiceImpl implements PagingService{
	@Resource(name="pagingDaoAop")//放在属性可以省略get set方法 也可以放在set方法前面
	private PagingDao pagingDao;
	@Resource(name="pagingSqlAopDao")//配置的属于哪个库dao
	private PagingSqlDao pagingSqlDao;
	
	public List<User> getQueryList(Map<String,Object> queryMap) {
		List<User> ls = this.pagingSqlDao.getUserListByPaging((Integer)queryMap.get("pgSize"),(Integer)queryMap.get("pgIdx"), queryMap);
		return ls;
	}

	@Override
	public int getQueryCount(Map<String,Object> queryMap) {
		return this.pagingSqlDao.getCountByPaging(queryMap);
	}

	@Override
	public List<Groups> getGroupsList(Map<String, Object> queryMap) {
		return this.pagingSqlDao.getGroupsList(queryMap);
	}
	@Override
	public int getGroupsCount(Map<String, Object> queryMap) {
		return this.pagingSqlDao.getGroupsCount(queryMap);
	}
}
